package com.niit.mapper;

import com.niit.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface CourseMapper {

    // 注解
    @Select("select * from course where course_id = #{course_id}")
    Course getById(int course_id);

    @Insert("insert into course values(#{course_id},#{course_name},#{course_type})")
    int insert(Course course);


    @Update("update course set course_name = #{course_name} where course_id = #{course_id}")
    int updateById(Course course);

    @Delete("delete from course where course_id = #{course_id}")
    int deleteById(int course_id);
}
